home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac: Not for Sale / Another.not.for.sale (Australia).iso / fade into you / getting there / TCP⁄PPP⁄SLIP / Scripts / SupraFAXModem V.32bis < prev   
Text File  |  1994-11-13  |  3KB  |  203 lines

  1. ! "SupraFAXModem V.32bis  - 3/22/93"
  2. ! Standard CCL - carrier speed 14.4 or less, hardware flow, serial 19.2K
  3. !
  4. !         3/22/93  MAW - added pause to fix PB wakeup
  5. !          10/19/93 CAF - changed to auto reliable mode
  6. @ORIGINATE
  7. @ANSWER
  8. !
  9. @LABEL 1
  10. serreset 19200, 0, 8, 1
  11.  
  12. !
  13. ! first recall the factory configuration, and get the modem in enhanced command state
  14. !
  15. ! For SupraPB modems so that they wake up in time to receive commands
  16. pause 30
  17. matchclr
  18. matchstr 1 4 "OK\13\10"
  19. write "AT &F1 \\N3 &Q5 W1 \13"
  20. matchread 30
  21. jump 59
  22. !
  23. ! Next, Set up the configuration:
  24. !                Turn off auto answer and echo
  25. !
  26. @LABEL 4
  27. pause 5
  28. matchstr 1 6 "OK\13\10"
  29. write "AT S0=0 E0 \13"
  30. matchread 30
  31. jump 59
  32. !
  33. ! If speaker on flag is true, 
  34. @LABEL 6
  35. ifstr 2 8 "1"
  36. matchstr 1 8 "OK\13\10"
  37. write "AT M0\13"
  38. matchread 30
  39. jump 59
  40. !
  41. ! The modem is ready so enable answering, or originate a call
  42. !
  43. @LABEL 8
  44. pause 5
  45. ifANSWER 30
  46. note "Dialing ^1" 3
  47. write "AT S0=0 DT^1\13"
  48. !
  49. @LABEL 9
  50. matchstr 1 11 "CARRIER 1200\13\10"
  51. matchstr 2 12 "CARRIER 2400\13\10"
  52. matchstr 3 13 "CARRIER 4800\13\10"
  53. matchstr 4 14 "CARRIER 7200\13\10"
  54. matchstr 5 15 "CARRIER 9600\13\10"
  55. matchstr 6 16 "CARRIER 12000\13\10"
  56. matchstr 7 17 "CARRIER 14400\13\10"
  57. matchstr 8 50 "NO CARRIER\13\10"
  58. matchstr 9 50 "ERROR\13\10"
  59. matchstr 10 52 "NO DIALTONE\13\10"
  60. matchstr 11 53 "BUSY\13\10"
  61. matchstr 12 54 "NO ANSWER\13\10"
  62. matchread 700
  63. jump 59
  64. !
  65. @LABEL 11
  66. note "Communicating at 1200 bps." 2
  67. CommunicatingAt 1200
  68. jump 20
  69. !
  70. @LABEL 12
  71. note "Communicating at 2400 bps." 2
  72. CommunicatingAt 2400
  73. jump 20
  74. !
  75. @LABEL 13
  76. note "Communicating at 4800 bps." 2
  77. CommunicatingAt 4800
  78. jump 20
  79. !
  80. @LABEL 14
  81. note "Communicating at 7200 bps." 2
  82. CommunicatingAt 7200
  83. jump 20
  84. !
  85. @LABEL 15
  86. note "Communicating at 9600 bps." 2
  87. CommunicatingAt 9600
  88. jump 20
  89. !
  90. @LABEL 16
  91. note "Communicating at 12000 bps." 2
  92. CommunicatingAt 12000
  93. jump 20
  94. !
  95. @LABEL 17
  96. note "Communicating at 14400 bps." 2
  97. CommunicatingAt 14400
  98. jump 20
  99. !
  100. ! Now CONNECTed.  Change to Hardware Handshaking
  101. @LABEL 20  
  102. HSReset 0 1 0 0 0 0
  103. ifANSWER 22
  104. pause 30
  105. !
  106. ! Finished. Return with good results
  107. @LABEL 22
  108. exit 0
  109. !
  110. ! @ANSWER
  111. ! Set up the modem to answer
  112. @LABEL 30
  113. write "ATS0=1\13"
  114. matchstr 1 31 "OK\13\10"
  115. matchread 30
  116. jump 59
  117. !
  118. @LABEL 31
  119. matchstr 1  32 "RING\13\10"
  120. matchstr 2  11 "CARRIER 1200\13\10"
  121. matchstr 3  12 "CARRIER 2400\13\10"
  122. matchstr 4  13 "CARRIER 4800\13\10"
  123. matchstr 5     14 "CARRIER 7200\13\10"
  124. matchstr 6  15 "CARRIER 9600\13\10"
  125. matchstr 7     16 "CARRIER 12000\13\10"
  126. matchstr 8  17 "CARRIER 14400\13\10"
  127. matchstr 9  50 "NO CARRIER\13\10"
  128. matchstr 10    50 "ERROR\13\10"
  129. matchstr 11    52 "NO DIALTONE\13\10"
  130. matchstr 12    53 "BUSY\13\10"
  131. matchstr 13 54 "NO ANSWER\13\10"
  132. matchread 700
  133. jump 31
  134. !
  135. @LABEL 32
  136. userhook 1
  137. note "Answering phone…" 2
  138. jump 31
  139. !
  140. ! 50: error messages
  141. !
  142. @LABEL 50
  143. exit -6021
  144. !
  145. @LABEL 52
  146. exit -6020
  147. !
  148. @LABEL 53
  149. exit -6022
  150. !
  151. @LABEL 54
  152. exit -6023
  153. !
  154. @LABEL 59
  155. exit -6019
  156. !
  157. ! Hang up the modem
  158. !
  159. @HANGUP
  160. @LABEL 60
  161. settries 0
  162. HSReset 0 0 0 0 0 0 
  163. @LABEL 61
  164. write "ATH\13"
  165. matchclr
  166. matchstr 1 62 "NO CARRIER\13\10"
  167. matchstr 2 62 "OK\13\10"
  168. matchstr 3 62 "ERROR\13\10"
  169. matchread 30
  170. inctries
  171. iftries 3 62
  172. ! no response, try escape sequence
  173. pause 12
  174. write "+++"
  175. matchclr
  176. matchstr 1 61 "OK\13\10"
  177. matchread 18
  178. ! try dropping DTR
  179. DTRClear
  180. pause 15
  181. DTRSet
  182. pause 15
  183. jump 61
  184. !
  185. @LABEL 62
  186. ! recall the factory settings
  187. pause 15
  188. write "AT&F1\13"
  189. matchclr
  190. matchstr 1 63 "OK\13\10"
  191. matchread 30
  192. !
  193. @LABEL 63
  194. pause 5
  195. matchstr 1 64 "OK\13\10"
  196. write "ATS0=0\13"
  197. matchread 20
  198. !
  199. @LABEL 64
  200. exit 0
  201.  
  202.